﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace LL3D
{
    public class ControlScheme
    { 
        Texture2D MenuControles;

        //Variaveis do cursor--------------------------------------------------------
        
        int option = 1;
        KeyboardState oldkeyState = Keyboard.GetState();
        //---------------------------------------------------------------------------

        public ControlScheme(ContentManager Content) //Construtor da classe
        {
            //Esse construtor serve para dar load das imagens relacionadas a tela inicial
            MenuControles = Content.Load<Texture2D>("MenuControles");
        }

        public void Update()
        {
            KeyboardState keyState = Keyboard.GetState();

            //Rodara a opcao escolhida ao apertarmos ENTER
            if (keyState.IsKeyUp(Keys.Enter) && !oldkeyState.IsKeyDown(Keys.Enter))
            {
                option = 2;           
            }
            if (option == 2 && keyState.IsKeyDown(Keys.Enter))
            {
                Game1.telaAtual = 2; 
            }
            oldkeyState = keyState;
        }

        public void Draw(SpriteBatch Spritebatch) // Draw da classe
        {
            Spritebatch.Begin();
            Spritebatch.Draw(MenuControles, new Rectangle(0, 0, 800, 600), Color.White);
            Spritebatch.End();
        }
    }
}
